var http = require('http');
var url = require('url');

function start(route){
  http.createServer(function(req,res){
    var pathname = url.parse(req.url).pathname;
    route(pathname);
    res.writeHead(200,{'Content-Type':'text/plain'});
    res.write('hello world');
    res.end();
  }).listen(8080);

  console.log('服务器已启动，运行在  http://localhost:8080');
}

exports.start = start;
